from django.conf.urls import re_path
from rest_framework.routers import SimpleRouter

from . import views

urlpatterns = [
    # 热门城市
    re_path(r'^city/hotlist/$',views.CityHotlistView.as_view()),
    # 增加企业访问次数
    re_path(r'^enterprise/(?P<pk>\d+)/visit/$',views.AddEnterpriseVisitView.as_view()),
    # 推荐职位
    re_path(r'^recruits/search/recommend/$',views.SearchRecommendView.as_view()),
    # 最新职位
    re_path(r'^recruits/search/latest/$',views.SearchLatestView.as_view()),
    # 热门企业
    re_path(r'^enterprise/search/hotlist/$',views.SearchHotlistEnterpriseView.as_view()),
    # 增加某个职位的访问量
    re_path(r'^recruits/(?P<pk>\d+)/visit/$',views.AddRecruitsVisitView.as_view()),
    # 搜索职位
    re_path(r'^recruits/search/city/keyword/$',  views.SearchJobView.as_view({'post':'search'}))
]

router = SimpleRouter()
# 企业详情
router.register('enterprise',views.EnterpriseView)
# 职位详情
router.register('recruits',views.RecruitsView)
# 收藏职位
router.register('recruits',views.RecruitCollectView,base_name='collect')
# 收藏企业
router.register('enterprise',views.EnterpriseCollectView,base_name='collect')

urlpatterns += router.urls